package com.github.shuaidd.model.repository;

import com.github.pagehelper.Page;
import org.activiti.app.domain.runtime.RelatedContent;
import org.apache.ibatis.annotations.Param;

public interface RelatedContentEntityMapper {
    int deleteByPrimaryKey(Long id);

    int insert(RelatedContent record);

    int insertSelective(RelatedContent record);

    RelatedContent selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(RelatedContent record);

    int updateByPrimaryKey(RelatedContent record);

    Page<RelatedContent> findAllRelatedBySourceAndSourceId(@Param("source") String source, @Param("sourceId") String sourceId);

    Page<RelatedContent> findAllRelatedByTaskId(@Param("taskId") String taskId);

    Page<RelatedContent> findAllFieldBasedContentByTaskId(@Param("taskId") String taskId);

    Page<RelatedContent> findAllByTaskIdAndField(@Param("taskId") String taskId, @Param("field") String field);

    Page<RelatedContent> findAllRelatedByProcessInstanceId(@Param("processInstanceId") String processId);

    Page<RelatedContent> findAllFieldBasedContentByProcessInstanceId(@Param("processInstanceId") String processId);

    Page<RelatedContent> findAllContentByProcessInstanceId(@Param("processInstanceId") String processId);

    Page<RelatedContent> findAllByProcessInstanceIdAndField(@Param("processInstanceId") String processId, @Param("field") String field);

    int deleteAllContentByProcessInstanceId(@Param("processInstanceId") String processInstanceId);

    Long getTotalContentSizeForUser(@Param("user") String user);
}
